//------------------------------------------------------------------------------
#ifndef __CCHAMPTEXT_H__
#define __CCHAMPTEXT_H__
//------------------------------------------------------------------------------
#include <QObject>
#include <QVariant>
#include <QDate>
#include "CChamp.h"
//------------------------------------------------------------------------------
class CCommun : public QObject
{
	Q_OBJECT
	Q_ENUMS(EDataType)
	Q_FLAGS(EEvalTime EEValTimes)
	public:
		enum EDataType {edtString=0, edtInt, edtDouble, edtDate};
		enum EEvalTime { evtNew=1, evtModif=2 };
		Q_DECLARE_FLAGS(EEValTimes, EEvalTime)
};
//------------------------------------------------------------------------------
class CChampText : public CChamp
{
	public:
		CCommun::EDataType getDataType(void) { return _dataType; }
		void setDataType(CCommun::EDataType dataType) { _dataType=dataType; }
		void setFormule(QString formule) { _formule=formule; }
		QString getFormule(void) { return _formule; }
		void setEvalTimes(CCommun::EEValTimes evalTimes) { _evalTimes=evalTimes; }
		CCommun::EEValTimes getEvalTimes(void) { return _evalTimes; }
	protected:
		QString toString(QVariant value);
		bool toBool(QString string);
		QString makeStyleSheet(EAttribut att, QString &toolTip);
	private:
		CCommun::EDataType _dataType;
		CCommun::EEValTimes _evalTimes;
		QString _formule;
};
//------------------------------------------------------------------------------
#endif //__CCHAMPTEXT_H__
//------------------------------------------------------------------------------
